"""day18 URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.urls import re_path
from rbac.views import user, role, permission

urlpatterns = [
    # 用户信息
    re_path(r'^user_list/$', user.User_list.as_view(), name='user_list'),
    re_path(r'^user_lookRole/(\d+)/$', user.User_lookRole.as_view(), name='user_lookRole'),
    re_path(r'^user_add/$', user.User_add.as_view(), name='user_add'),
    re_path(r'^user_edit/(\d+)/$', user.User_edit.as_view(), name='user_edit'),
    re_path(r'^user_del/(\d+)/$', user.User_del.as_view(), name='user_del'),

    # 角色信息
    re_path(r'^role_list/$', role.Role_list.as_view(), name='role_list'),
    re_path(r'^role_lookPermission/(\d+)/$', role.Role_lookPermission.as_view(), name='role_lookPermission'),
    re_path(r'^role_add/$', role.Role_add.as_view(), name='role_add'),
    re_path(r'^role_edit/(\d+)/$', role.Role_edit.as_view(), name='role_edit'),
    re_path(r'^role_del/(\d+)/$', role.Role_del.as_view(), name='role_del'),

    # 权限信息
    re_path(r'^permission_list/$', permission.Permission_list.as_view(), name='permission_list'),
    re_path(r'^permission_add/$', permission.Permission_add.as_view(), name='permission_add'),
    re_path(r'^permission_edit/(\d+)/$', permission.Permission_edit.as_view(), name='permission_edit'),
    re_path(r'^permission_del/(\d+)/$', permission.Permission_del.as_view(), name='permission_del'),
]
